﻿@model TestOnlineProject.Models.Entities.User
@{
    ViewBag.Title = "Register";
}
<script type="text/javascript">
    function validate() {
        Password = document.getElementById('Password');
        ReEnterPassword = document.getElementById('ReEnterPassword');
        if (Password.value != ReEnterPassword.value) {
            document.getElementById('ReEnterPassword_Message').innerHTML = "Re-Enter Password must equal Password."
            return false;
        }
        return true;
    }
</script>
<h4>
    Register</h4>
<fieldset>
    <legend>Account Information</legend>
    @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { onsubmit = "return validate()" }))
    {@Html.ValidationSummary(true)
        <table class="table table-bordered">
            <tr>
                <td style="width: 100px; text-align: right">
                    <span>CMS Username</span>
                </td>
                <td>
                    @Html.TextBoxFor(model => model.Username)
                    <span class="errorMsg">@Html.ValidationMessageFor(model => model.Username)</span>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    <span>Password</span>
                </td>
                <td>
                    @Html.PasswordFor(model => model.Password)
                    <span class="errorMsg">@Html.ValidationMessageFor(model => model.FullName)</span>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    <span>Re-Enter Password</span>
                </td>
                <td>
                    <input type="password" id="ReEnterPassword" />
                    <span class="errorMsg" id="ReEnterPassword_Message"></span>
                </td>
            </tr>
            <tr>
                <td style="width: 150px; text-align: right">
                    <span>Full Name</span>
                </td>
                <td>
                    @Html.TextBoxFor(model => model.FullName)
                    <span class="errorMsg">@Html.ValidationMessageFor(model => model.FullName)</span>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                </td>
                <td>
                    <input type="submit" value="Create" class="btn" style="width: 80px" />
                    <input type="reset" value="Reset" class="btn" style="width: 80px" />
                </td>
            </tr>
        </table>                        
    }
</fieldset>
